dragdest: Simplify function
authorBenjamin Otte <otte@redhat.com>
Sun, 16 Feb 2020 17:43:45 +0000 (18:43 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 17 Feb 2020 03:04:21 +0000 (04:04 +0100)
Make it obvious that the functions checks one condition and then the
other.

gtk/gtkdragdest.c

index 9d8489d45e90ce1885fc2fbf4f5b83b3c19df0cc..65d6faad75fe9e61cd8e490625b6403bbf35bba4 100644 (file)
@@ -564,14 +564,10 @@ static gboolean
 gtk_drop_target_accept (GtkDropTarget *dest,
                         GdkDrop       *drop)
 {
-  GdkDragAction dest_actions;
-  GdkDragAction actions;
-
-  dest_actions = gtk_drop_target_get_actions (dest);
-
-  actions = dest_actions & gdk_drop_get_actions (drop);
+  if ((gdk_drop_get_actions (drop) & gtk_drop_target_get_actions (dest)) == 0)
+    return FALSE;
 
-  return actions && gdk_content_formats_match (dest->formats, gdk_drop_get_formats (drop));
+  return gdk_content_formats_match (dest->formats, gdk_drop_get_formats (drop));
 }
 
 static void